package  
{
	import flash.text.TextField;
	import flash.text.TextFormat;
	/**
	 * ...
	 * @author patsup
	 * 
	 * 
	 * Producer: Miles Aurbeck
	 * Programmer: Patrick Supanwanid
	 * Artwork: ?
	 * Sound/Music: ?
	 * Achievements: Josh Foote
	 * 
	 */
	public class InfoMenu extends Menu 
	{
		//menu image parameters
		private const COLOR:int = 0x00FF00;
		private const WIDTH:int = 800;
		private const HEIGHT:int = 480;
		
		private const MENU_BUTTON_X_STARTLOC:int = 500;			//Button for return back to menu
		private const MENU_BUTTON_Y_STARTLOC:int = 420;
		
		private var txtLabel:TextField;
		private var txtInstructions:TextField;
		private var txtFormat:TextFormat;
		
		private var mainRef:Main;
		
		private var menuButtonImgData:ImageData;
		private var menuButton:MenuButton;						//return to start menu button
		
		public function InfoMenu(mainRef:Main) 
		{
			txtLabel = new TextField();
			txtInstructions = new TextField();
			txtFormat = new TextFormat();
			
			this.mainRef = mainRef;
			
			graphics.beginFill(COLOR);
			graphics.drawRect(0, 0, WIDTH, HEIGHT);
			graphics.endFill();
			
			txtLabel.text = "Info Menu";
			txtInstructions.text = "How-To:\n\nSet up:\nClick Start\nClick New Game or Resume a previous one (Saves Locally Only)\nOn the Pre-Round screen, place your bet\n\n";
			txtInstructions.appendText("The Game:\nClick Play\nClick the Dice to roll\nSelect the pirates that equal the roll\nExecute them\n");
			txtInstructions.appendText("Continue until you can no longer execute any pirates\nThe lower your score the better -- Try for a 0 !\n");
			txtInstructions.appendText("You can gain achievements throughout gameplay.\nCheck out the achievements page from the pre-round menu!");
			txtFormat.size = 20;
			txtInstructions.setTextFormat(txtFormat);
			txtInstructions.width = txtInstructions.textWidth*1.2;
			txtInstructions.height = txtInstructions.textHeight*1.2;
			txtInstructions.x = 50;
			txtInstructions.y = 25;
			
			addChild(txtLabel);
			addChild(txtInstructions);
			
			menuButtonImgData = new ImageData(MENU_BUTTON_X_STARTLOC, MENU_BUTTON_Y_STARTLOC, "Back");
			menuButton = new MenuButton(menuButtonImgData, MenuBtnInputMouseClick);
			
			
			addChild(menuButton);
			
			
			InitImage();
			
		}
		
		//InitImage()
		//Initializes the image of the Menu
		protected override function InitImage():void
		{
			
			super.InitImage();
		}
		//MenuBtnInputMouseClick()
		//called on back menu button mouse click
		protected function MenuBtnInputMouseClick():void
		{
			mainRef.ReturnToStartMenu(this);
		}
	}

}